# -*- encoding:utf-8 -*-
# __author__ = 'chenyongbing'
# __poject__ = 'ops_platform'
# __datetime__ = '2022/6/13'
# __name__ = 'serializers.py'
from rest_framework import serializers
from .models import *
# Create your code here.


class GitCommitSerializer(serializers.ModelSerializer):
    class Meta:
        model = GitCommit
        fields = ['projectname', 'ref', 'shortcommitid', 'committer', 'committed_date', 'total', 'additions', 'deletions', 'merge_date']


class GitCommitDayStatSerializer(serializers.ModelSerializer):
    class Meta:
        model = GitCommitDayStat
        fields = '__all__'


class GitCommitCycleStatSerializer(serializers.ModelSerializer):
    committed_times = serializers.IntegerField()
    class Meta:
        model = GitCommitDayStat
        fields = ['committer', 'committed_times', 'total', 'additions', 'deletions']